<?php include_once ('function/check_login_function.php'); onlyValid();?>
<!DOCTYPE html>
<html>
<head>
	<title>Hospitals</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="">
</head>
<body>
	<div id="wrap">
		<header>
		</header>
		<div id="main">
			<div id="menu">
			</div>
			<div id="content">
				
					<?php 
					$hospital_list = Hospital::getHospitalList();
					if ($hospital_list !== null) {
						foreach ($hospital_list as $hospital) {
							echo '<div><ul>';
							echo '<li>' . $hospital['hospital_name'] . '</li>';
							if ($hospital['hospital_address'] !== "") {
								echo '<li>' . $hospital['hospital_address'] . '</li>';
							} else {
								echo '<li> No address stated</li>';
							}
							if ($hospital['hospital_contact'] !== "") {
								echo '<li>' . $hospital['hospital_contact'] . '</li>';
							} else {
								echo '<li> No contact stated</li>';
							}
							echo '<li><a href="doctors.php?hospital=' . $hospital['hospital_id'] . '">Select</a></li>';
							echo '</ul></div>';
						}
					}
					?>				
			</div>
		</div>
		<footer>
			<div id="footer">
				
			</div>
		</footer>
	</div>
</body>